package com.aiit.controller;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.aiit.pojo.Dept;
import com.aiit.pojo.ProcResult;
import com.aiit.service.impl.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/dept")
public class DepartmentController {
	@Resource
	DeptService deptService;
	//查询所有部门
	@RequestMapping("/findAllDepts")
	@ResponseBody	
	public ProcResult findAllDepts() {
		List<Dept> deptList = deptService.findAllDepts();
		System.out.println("findAllDepts"+deptList);
		return ProcResult.success().bind("deptList", deptList);
		
	}
	/*
	@RequestMapping("/findEmpNums")
	@ResponseBody
	public Map<String, Object> countEmp() {
		System.out.println("findEmpNums。。。");
		Map<String, Object> baseMap =new HashMap<String,Object>();
		
		List<Map<String, Object>> baseList  = deptService.findEmpNum();
		System.out.println(baseList);	
		baseMap.put("data", baseList);
		
		    return baseMap;
		
	}*/
	
}
